package com.jieao.content.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jieao.common.core.domain.BaseEntity;
import com.jieao.framework.util.ShiroUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * @Description 日记
 * @Author weifanl
 * @Date2020/5/21 15:34
 **/
@Data
@TableName("content_diary")
@EqualsAndHashCode(callSuper = true)
public class Diary extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @TableId
    private  Long   id;			//日记id
    private  Long   catalogId;	//目录id
    private  Long   subId;			//日记内容id
    private  String   title;		//日记标题
    private  String   desca;		//日记描述
    private  String   isRelease;	//是否发布
    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date releaseTime;
    private  Integer   delFlag;	//删除标志（0代表存在 2代表删除）

    public Diary(){
        this.delFlag = 0;
        setUpdateBy(ShiroUtils.getLoginName());
        setUpdateTime(new Date());
    }
}
